package com.scs.application.modules.wm.enums;

import com.scs.application.core.exception.BusinessException;
import com.scs.application.core.utils.StringUtils;

public enum  UniqueCodeType {
    SN,
    RFID,
    UDI;


    public static UniqueCodeType parse(String ucType) {

       if(StringUtils.isBlank(ucType)) {
           throw new BusinessException("未知的唯一码类型");
       }

       if(SN.name().equalsIgnoreCase(ucType.toUpperCase())){
           return SN;
       }

        if(RFID.name().equalsIgnoreCase(ucType.toUpperCase())){
            return RFID;
        }

        if(UDI.name().equalsIgnoreCase(ucType.toUpperCase())){
            return UDI;
        }
        throw new BusinessException("未知的唯一码类型");
    }
}
